package ie.dcu.spca.view.product;

import java.util.List;
import java.util.Map;

import android.os.Bundle;

import ie.dcu.spca.Main;
import ie.dcu.spca.data.BasicDataManager;
import ie.dcu.spca.data.ProductDataManager;
import ie.dcu.spca.model.Bean;
import ie.dcu.spca.view.DataList;

public class ProductList extends DataList {

    private static ProductDataManager productManager;

    protected void afterOnCreateInvoke(Bundle savedInstanceState) {
        super.afterOnCreateInvoke(savedInstanceState);
        productManager = Main.dataManager.productDataManager();
    }

    @Override
    protected BasicDataManager getBeanDataManager() {
        return productManager;
    }

    @Override
    protected Class getCRUDDialog() {
        return ProductCRUDDialog.class;
    }

    @Override
    protected List<Bean> getDataListForRefreshOnWindowHasFocus() {
        return (List) productManager.get();
    }

    @Override
    protected void setBundleBeforeStartCRUDDialogForUpdate(Bundle bundle,
            Map<String, Object> dataMap) {
    }

}
